home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 25.2 KB | 737 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWAcquir.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWACQUIR_H
- #include "FWAcquir.h"
- #endif
-
- #ifndef FWMEMMGR_H
- #include "FWMemMgr.h"
- #endif
-
- #ifndef SOM_ODWindow_xh
- #include "Window.xh"
- #endif
-
- #ifndef SOM_ODFrame_xh
- #include "Frame.xh"
- #endif
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- #ifndef SOM_ODTransform_xh
- #include <Trnsform.xh>
- #endif
-
- #ifndef SOM_ODStorageUnit_xh
- #include <StorageU.xh>
- #endif
-
- #ifndef SOM_ODStorageUnitView_xh
- #include <SUView.xh>
- #endif
-
- #ifndef SOM_ODStorageUnitCursor_xh
- #include <SUCursor.xh>
- #endif
-
- #ifndef SOM_ODMenuBar_xh
- #include <MenuBar.xh>
- #endif
-
- #ifndef SOM_ODPart_xh
- #include <Part.xh>
- #endif
-
- //========================================================================================
- // Runtime Informations
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwodutil
- #endif
-
- //========================================================================================
- // FW_PrivODRelease
- //========================================================================================
-
- static void FW_PrivODRelease(ODRefCntObject* object)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- if (object)
- object->Release(somGetGlobalEnvironment());
- #endif
- }
-
- //========================================================================================
- // FW_PrivAssignAndAcquire
- //========================================================================================
-
- static void FW_PrivAssignAndAcquire(ODRefCntObject* oldObject, ODRefCntObject* newObject)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- if (oldObject != newObject)
- {
- Environment* ev = somGetGlobalEnvironment();
-
- if (oldObject != NULL)
- oldObject->Release(ev);
-
- newObject->Acquire(ev);
- }
- #endif
- }
-
- //========================================================================================
- // FW_PrivAssign
- //========================================================================================
-
- static void FW_PrivAssign(ODRefCntObject* oldObject, ODRefCntObject* newObject)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- if (oldObject != NULL && oldObject != newObject)
- {
- oldObject->Release(somGetGlobalEnvironment());
- }
- #endif
- }
-
- //========================================================================================
- // FW_CAcquiredODWindow::FW_CAcquiredODWindow
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODWindow::FW_CAcquiredODWindow
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODWindow::FW_CAcquiredODWindow() :
- fODWindow(NULL)
- {
- // Is Acquire() missing here?
- // As Jim Lloyd wrote in a mail message on Oct 5, 1995
- // No, the logic is that the object has already been acquired once, and
- // the helper object is just used to ensure the object will be released.
- // We were talking about this just today, and agreed that the FW_CAcquiredXXX
- // classes should be renamed to FW_CXXXReleaser.
- //
- // Note that the reason for the asymmetry is beyond our control, and has to do
- // with thread safety. The function to "get" an object must increment the
- // reference count in the same operation. If the get and the acquire are separate,
- // it's possible that another thread might release the object before the acquisition
- // happens.
- //
- // Jim
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODWindow::FW_CAcquiredODWindow
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODWindow::FW_CAcquiredODWindow(ODWindow* odWindow) :
- fODWindow(odWindow)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODWindow::FW_CAcquiredODWindow
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODWindow::FW_CAcquiredODWindow(const FW_CAcquiredODWindow& other) :
- fODWindow(other.fODWindow)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODWindow->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODWindow::~FW_CAcquiredODWindow
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODWindow::~FW_CAcquiredODWindow()
- {
- FW_START_DESTRUCTOR
- ::FW_PrivODRelease(fODWindow);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODWindow::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODWindow& FW_CAcquiredODWindow::operator=(ODWindow* odWindow)
- {
- FW_PrivAssign(fODWindow, odWindow);
- fODWindow = odWindow;
-
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODWindow::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODWindow& FW_CAcquiredODWindow::operator=(const FW_CAcquiredODWindow& other)
- {
- FW_PrivAssignAndAcquire(fODWindow, other.fODWindow);
- fODWindow = other.fODWindow;
- return *this;
- }
-
- //========================================================================================
- // FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit() :
- fODStorageUnit(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit(ODStorageUnit* storageUnit) :
- fODStorageUnit(storageUnit)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODStorageUnit::FW_CAcquiredODStorageUnit(const FW_CAcquiredODStorageUnit& other) :
- fODStorageUnit(other.fODStorageUnit)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODStorageUnit->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODStorageUnit::~FW_CAcquiredODStorageUnit
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODStorageUnit::~FW_CAcquiredODStorageUnit()
- {
- FW_START_DESTRUCTOR
-
- ::FW_PrivODRelease(fODStorageUnit);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODStorageUnit::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODStorageUnit& FW_CAcquiredODStorageUnit::operator=(ODStorageUnit* storageUnit)
- {
- FW_PrivAssign(fODStorageUnit, storageUnit);
- fODStorageUnit = storageUnit;
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODStorageUnit::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODStorageUnit& FW_CAcquiredODStorageUnit::operator=(const FW_CAcquiredODStorageUnit& other)
- {
- FW_PrivAssignAndAcquire(fODStorageUnit, other.fODStorageUnit);
- fODStorageUnit = other.fODStorageUnit;
- return *this;
- }
-
- //========================================================================================
- // FW_CAcquiredODFrame::FW_CAcquiredODFrame
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODFrame::FW_CAcquiredODFrame
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODFrame::FW_CAcquiredODFrame() :
- fODFrame(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODFrame::FW_CAcquiredODFrame
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODFrame::FW_CAcquiredODFrame(ODFrame* odFrame) :
- fODFrame(odFrame)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODFrame::FW_CAcquiredODFrame
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODFrame::FW_CAcquiredODFrame(const FW_CAcquiredODFrame& other) :
- fODFrame(other.fODFrame)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODFrame->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODFrame::~FW_CAcquiredODFrame
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODFrame::~FW_CAcquiredODFrame()
- {
- FW_START_DESTRUCTOR
-
- ::FW_PrivODRelease(fODFrame);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODFrame::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODFrame& FW_CAcquiredODFrame::operator=(ODFrame* odFrame)
- {
- FW_PrivAssign(fODFrame, odFrame);
- fODFrame = odFrame;
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODFrame::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODFrame& FW_CAcquiredODFrame::operator=(const FW_CAcquiredODFrame& other)
- {
- FW_PrivAssignAndAcquire(fODFrame, other.fODFrame);
- fODFrame = other.fODFrame;
- return *this;
- }
-
- //========================================================================================
- // FW_CAcquiredODPart::FW_CAcquiredODPart
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODPart::FW_CAcquiredODPart
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODPart::FW_CAcquiredODPart() :
- fODPart(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODPart::FW_CAcquiredODPart
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODPart::FW_CAcquiredODPart(ODPart* odPart) :
- fODPart(odPart)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODPart::FW_CAcquiredODPart
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODPart::FW_CAcquiredODPart(const FW_CAcquiredODPart& other) :
- fODPart(other.fODPart)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODPart->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODPart::~FW_CAcquiredODPart
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODPart::~FW_CAcquiredODPart()
- {
- FW_START_DESTRUCTOR
-
- ::FW_PrivODRelease(fODPart);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODPart::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODPart& FW_CAcquiredODPart::operator=(ODPart* odPart)
- {
- FW_PrivAssign(fODPart, odPart);
- fODPart = odPart;
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODPart::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODPart& FW_CAcquiredODPart::operator=(const FW_CAcquiredODPart& other)
- {
- FW_PrivAssignAndAcquire(fODPart, other.fODPart);
- fODPart = other.fODPart;
- return *this;
- }
-
- //========================================================================================
- // Class FW_CAcquiredODShape
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODShape::FW_CAcquiredODShape
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODShape::FW_CAcquiredODShape() :
- fODShape(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODShape::FW_CAcquiredODShape
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODShape::FW_CAcquiredODShape(ODShape* odShape) :
- fODShape(odShape)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODShape::FW_CAcquiredODShape
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODShape::FW_CAcquiredODShape(const FW_CAcquiredODShape& other) :
- fODShape(other.fODShape)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODShape->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODShape::~FW_CAcquiredODShape
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODShape::~FW_CAcquiredODShape()
- {
- FW_START_DESTRUCTOR
-
- ::FW_PrivODRelease(fODShape);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODShape::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODShape& FW_CAcquiredODShape::operator=(ODShape* odShape)
- {
- FW_PrivAssign(fODShape, odShape);
- fODShape = odShape;
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODShape::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODShape& FW_CAcquiredODShape::operator=(const FW_CAcquiredODShape& other)
- {
- FW_PrivAssignAndAcquire(fODShape, other.fODShape);
- fODShape = other.fODShape;
- return *this;
- }
-
- //========================================================================================
- // Class FW_CAcquiredODTransform
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODTransform::FW_CAcquiredODTransform
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODTransform::FW_CAcquiredODTransform() :
- fODTransform(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODTransform::FW_CAcquiredODTransform
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODTransform::FW_CAcquiredODTransform(ODTransform* odTransform) :
- fODTransform(odTransform)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODTransform::FW_CAcquiredODTransform
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODTransform::FW_CAcquiredODTransform(const FW_CAcquiredODTransform& other) :
- fODTransform(other.fODTransform)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODTransform->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODTransform::~FW_CAcquiredODTransform
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODTransform::~FW_CAcquiredODTransform()
- {
- FW_START_DESTRUCTOR
-
- ::FW_PrivODRelease(fODTransform);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODTransform::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODTransform& FW_CAcquiredODTransform::operator=(ODTransform* odTransform)
- {
- FW_PrivAssign(fODTransform, odTransform);
- fODTransform = odTransform;
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODTransform::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODTransform& FW_CAcquiredODTransform::operator=(const FW_CAcquiredODTransform& other)
- {
- FW_PrivAssignAndAcquire(fODTransform, other.fODTransform);
- fODTransform = other.fODTransform;
- return *this;
- }
-
- //========================================================================================
- // Class FW_CAcquiredODMenuBar
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODMenuBar::FW_CAcquiredODMenuBar
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODMenuBar::FW_CAcquiredODMenuBar() :
- fODMenuBar(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODMenuBar::FW_CAcquiredODMenuBar
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODMenuBar::FW_CAcquiredODMenuBar(ODMenuBar* odMenuBar) :
- fODMenuBar(odMenuBar)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODMenuBar::FW_CAcquiredODMenuBar
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODMenuBar::FW_CAcquiredODMenuBar(const FW_CAcquiredODMenuBar& other) :
- fODMenuBar(other.fODMenuBar)
- {
- #if FW_OPENDOC_VERSION >= FW_OPENDOC_DR3
- fODMenuBar->Acquire(somGetGlobalEnvironment());
- #endif
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODMenuBar::~FW_CAcquiredODMenuBar
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODMenuBar::~FW_CAcquiredODMenuBar()
- {
- FW_START_DESTRUCTOR
-
- ::FW_PrivODRelease(fODMenuBar);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODMenuBar::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODMenuBar& FW_CAcquiredODMenuBar::operator=(ODMenuBar* odMenuBar)
- {
- FW_PrivAssign(fODMenuBar, odMenuBar);
- fODMenuBar = odMenuBar;
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquiredODMenuBar::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CAcquiredODMenuBar& FW_CAcquiredODMenuBar::operator=(const FW_CAcquiredODMenuBar& other)
- {
- FW_PrivAssignAndAcquire(fODMenuBar, other.fODMenuBar);
- fODMenuBar = other.fODMenuBar;
- return *this;
- }
-
- //========================================================================================
- // class FW_CAcquireODStorageUnitView
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODStorageUnitView::FW_CAcquireODStorageUnitView
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODStorageUnitView::FW_CAcquireODStorageUnitView(Environment* ev, ODStorageUnit* su,
- ODPropertyName propertyName,
- ODPositionCode propertyPosCode,
- ODValueType valueType,
- ODValueIndex valueIndex,
- ODPositionCode valuePosCode) :
- fSUView(NULL)
- {
- su->Focus(ev, propertyName, propertyPosCode, valueType, valueIndex, valuePosCode);
- fSUView = su->CreateView(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODStorageUnitView::FW_CAcquireODStorageUnitView
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODStorageUnitView::FW_CAcquireODStorageUnitView(Environment* ev, ODStorageUnit* su) :
- fSUView(NULL)
- {
- fSUView = su->CreateView(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODStorageUnitView::~FW_CAcquireODStorageUnitView
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODStorageUnitView::~FW_CAcquireODStorageUnitView()
- {
- delete fSUView;
- }
-
- //========================================================================================
- // class FW_CAcquireODPropertyName
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODPropertyName::FW_CAcquireODPropertyName
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODPropertyName::FW_CAcquireODPropertyName(Environment* ev, ODStorageUnit* su) :
- fPropName(NULL)
- {
- fPropName = su->GetProperty(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODPropertyName::FW_CAcquireODPropertyName
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODPropertyName::FW_CAcquireODPropertyName(Environment* ev, ODStorageUnitView* suView) :
- fPropName(NULL)
- {
- fPropName = suView->GetProperty(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODPropertyName::FW_CAcquireODPropertyName
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODPropertyName::FW_CAcquireODPropertyName(Environment* ev, ODStorageUnitCursor* suCursor) :
- fPropName(NULL)
- {
- suCursor->GetProperty(ev, &fPropName);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAcquireODPropertyName::~FW_CAcquireODPropertyName
- //----------------------------------------------------------------------------------------
-
- FW_CAcquireODPropertyName::~FW_CAcquireODPropertyName()
- {
- if (fPropName != NULL)
- FW_CMemoryManager::FreeBlock(fPropName);
- }
-
- //========================================================================================
- // FW_CopyAndRelease
- //========================================================================================
-
- //########################################################################################
- // SCpp Hack
- // Work around SCpp 8.0.3 bug - importing overloaded functions doesn't work.
- // Replace overloaded functions with normal functions with different names.
- // Use inline overloaded functions which turn around and call the renamed
- // functions so client code isn't affected.
- //########################################################################################
-
- //----------------------------------------------------------------------------------------
- // ODShape
- //----------------------------------------------------------------------------------------
-
- FW_FUNC_ATTR ODShape* FW_CopyAndRelease_Shape(Environment* ev, ODShape* shapeToCopy)
- {
- FW_ASSERT(shapeToCopy != NULL);
- FW_ASSERT(shapeToCopy->GetRefCount(ev) >= 1);
-
- FW_CAcquiredODShape aqShapeToCopy(shapeToCopy);
- return aqShapeToCopy->Copy(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // ODTransform
- //----------------------------------------------------------------------------------------
-
- FW_FUNC_ATTR ODTransform* FW_CopyAndRelease_Transform(Environment* ev, ODTransform* transformToCopy)
- {
- FW_ASSERT(transformToCopy != NULL);
- FW_ASSERT(transformToCopy->GetRefCount(ev) >= 1);
-
- FW_CAcquiredODTransform aqTransformToCopy(transformToCopy);
- return transformToCopy->Copy(ev);
- }
-